<!-- 子组件 (Vue 2) -->
<template>
  <div>我是子组件: {{ name }}</div>
</template>
<script>
export default {
  data() {
    return {
      name: 'child'
    }
  },
  mounted() {
    // this.$emit('child-event', '数据')
  },
  methods: {
    childMethod(params) {
      console.log('子组件方法被调用了', params)
      this.name = params
    }
  }
}
</script>
